<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Vue:事件和双向数据绑定</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<style>

		</style>
	</head>
	<body>
		<div id="msg">
			<p>{{message}}</p>
			<button @click="reverse">触发反转</button>
			<br>
			<input type='text' v-model:value="message"/>
		</div>
		<script type="text/javascript">
			var app = new Vue({
				el: '#msg',
				data: {
					message: 'Hello VUE!'
				},
				methods:{
					reverse: function () {
						this.message = this.message.split('').reverse().join('');
					}
				}
			});
		</script>
	</body>
</html>
